import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:leader_help/page/home/area_compete/index.dart';
import 'package:leader_help/page/home/models/province_level.dart';
import 'package:leader_help/utils/util.dart';

class AreaCompeteCell extends GetView<AreaCompeteController> {
  const AreaCompeteCell({Key? key, required this.mod, required this.index})
      : super(key: key);
  final ProvinceLevelModel mod;
  final int index;
  @override
  Widget build(BuildContext context) {
    List<String> indexs = ["一", "二", "三", "四", "五", "六", "七", "八", "九"];
    return Container(
      height: 80.r,
      margin: EdgeInsets.fromLTRB(10.r, 0, 10.r, 10.h),
      padding: EdgeInsets.symmetric(horizontal: 15.r),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(5.r),
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Text.rich(
            TextSpan(
                text: '${indexs[index]}、' + mod.province,
                style: pfMediumStyle(color: ColorsUtil.red, fontSize: 15.sp),
                children: mod.isCurrent == true
                    ? [
                        TextSpan(
                          text: '（本省）',
                          style: pfMediumStyle(
                              color: ColorsUtil.orange, fontSize: 14.sp),
                        )
                      ]
                    : null),
          ),
          mod.isCurrent == true
              ? const SizedBox()
              : Container(
                  padding:
                      const EdgeInsets.symmetric(horizontal: 5, vertical: 2),
                  decoration: BoxDecoration(
                    color: ColorsUtil.bg,
                    borderRadius: BorderRadius.circular(3),
                  ),
                  child: Text(
                    '与本省对标',
                    style:
                        pfMediumStyle(color: ColorsUtil.title, fontSize: 13.sp),
                  ),
                )
        ],
      ),
    );
  }
}
